<template>
    <div class="hot-sell">
            <!-- 插槽 -->
            <slot name='comprehensiveList'></slot>
            
            <div class="item-box">

                <div 
                class="item-box-content" 
                @click="gotoGoodsDetail"
                v-for="(item,index) in recArr"
                :key="index"
                >
                    <div class="item-box-content-image">
                        <img :src="item.url" alt="">
                    </div>
                    <div class="item-box-content-title">
                        <p>{{item.desc}}</p>
                    </div>
                    <div class="item-box-content-price">
                        <p>￥{{item.price}}.00</p>
                        <img
                            src="../../../../../assets/images/al-icon-cart.png"
                            alt=""
                            class="iconImg"
                        />
                    </div>
                </div>
                

                


            </div>
        </div>
</template>

<script>
import api from "../../../../../api";
export default {
    name:'ListDetailsHotsell',
    data(){
        return{
            recArr:[]
        }
    },
    methods:{
        gotoGoodsDetail(){
            this.$router.push('/listGoodsDetails')
        }
    },
    mounted(){
        // 推荐
        api.getRecommend().then(res=>{
            console.log(res.data.list);
            this.recArr=res.data.list;
        })
    }
}
</script>

<style lang='less' scoped>
    
.hot-sell{
    width: 100%;
    min-height: 400px;
   
    .hot-sell-title{
            width: 100%;
            height: 23px;
            line-height: 23px;
            text-align: center;
            padding-top: 9px;
            padding-bottom: 8px;
            background-color: #F3F4F5;
            p{
                font-size: 12px;
                font-family: Arial;
                color: rgba(102, 102, 102, 1);
                background-color:#F3F4F5;
            }
    }
    .hot-sell-column{
        display: flex;
        flex-wrap: wrap;
        width: 100%;
        height: 39px;
        line-height: 39px;
        div{
            flex:0 0 25%;
            height: 100%;
            text-align: center;
            font-size: 14px;
            font-family: Arial;
        }
    }
}
.item-box{
    width: 100%;
    height: 530px;
    display: flex;
    flex-wrap: wrap;
    padding-top: 5px;
    background-color: #F3F4F5 ;
}
.item-box-content{
    flex: 0 0 47%;
    height: 260px;
    margin:5px 5px;
    background-color: white;
}
.item-box-content-image{
    width: 176px;
    height: 155px;
    float: right;
    margin-bottom: 8px;
}
.item-box-content-image img{
    width: 100%;
    height: 100%;
}
.item-box-content-title{
    width: 162px;
    height: 40px;
    line-height: 20px;
    text-align: left;
    overflow : hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 16px;
    p{
        color: rgba(16, 16, 16, 1);
        font-size: 14px;
        font-family: Arial;
    }
}
.item-box-content-price{
    width: 162px;
    height: 31px;
    position: relative;
    p{
        line-height: 31px;
        color: rgba(111, 68, 138, 1);
        font-size: 14px;
        text-align: left;
        font-family: Arial;
    }
    img{
        width: 25px;
        height: 25px;
        position: absolute;
        right: 0;
        top: 0;
    }
}
</style>
